package com.furongji.education.controller.api;

import com.furongji.common.result.Result;
import com.furongji.education.domain.vo.SubjectVo;
import com.furongji.education.service.SubjectService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Tag(name = "用户端课程分类管理")
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/courses")
public class SubjectApiController {

    private final SubjectService subjectService;

    @Operation(summary = "查询课程分类")
    @GetMapping("/listSubject")
    public Result listSubject() {
        List<SubjectVo> subjectVoList = subjectService.selectSubject();
        return Result.success(subjectVoList);
    }
}
